<template>
	<view class="pd-md" style="width: 100%; height: 100%;"> 
		<MyTable :columns="columns" :rows="rows" :headerStyle="headerStyle" :bodyStyle="bodyStyle" :onTapRow="onTapRow" ></MyTable>
	</view> 
</template>

<script>
	import {
	  getMerExtractList, getMerRechargeList
	} from "@/api/fsh.js";
	
	import MyTable from '../components/my/MyTable.vue';
	
	export default {
		components: {
			MyTable
		},
		data() {
			return {
				headerStyle: {
					'height': '80rpx',
					'background-color': '#FFF',
					'border-bottom': '1px solid #f8f8f8',
					'font-weight': 'bold'
				},
				
				bodyStyle: {
					'background-color': '#FFF',
				},
				
				columns: [],
				rows: [],
				
			}
		},
		onLoad(options) {
			this.pageType = options.pageType;
			this.merId = options.merId;
			
			if(options.pageType == 1) {
				uni.setNavigationBarTitle({
					title: '提现记录'
				})
				getMerExtractList(options.merId).then(res=>{
					this.columns = res.entity.columns;
					this.rows = res.entity.rows;
					this.keys = res.entity.keys;
				}).catch(err=>{
					
				});
			}
			else if(options.pageType == 2) {
				uni.setNavigationBarTitle({
					title: '充值记录'
				})
				getMerRechargeList(options.merId).then(res=>{
					this.columns = res.entity.columns;
					this.rows = res.entity.rows;
					this.keys = res.entity.keys;
				}).catch(err=>{
					
				});
			}
		},
		methods: {
			onTapRow(rowidx) {
				
				console.log("onTapRow: " + rowidx);
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		height: 100vh;
		width: 100vw;
	}
</style>
